/*
 *

 *
 */
package com.sx.wechat.security;

import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;

import java.io.Serializable;


/**
 * 身份信息.
 *
 * @version  1.0
 * @author   <a href="mailto:lihao@ozstrategy.com">Hao Li</a>
 */
public class Principal implements Serializable {
  //~ Static fields/initializers ---------------------------------------------------------------------------------------

  private static final long serialVersionUID = 5798882004228239559L;
  /**
   * 学号
   */
  private String bindno;
  /**
   * 学号
   */
  private String bindtype;

  private String id;

  private String type;


  public Principal(){

  }

  public String getBindno() {
    return bindno;
  }

  public void setBindno(String bindno) {
    this.bindno = bindno;
  }

  public String getBindtype() {
    return bindtype;
  }

  public void setBindtype(String bindtype) {
    this.bindtype = bindtype;
  }

  public String getId() {
    return id;
  }

  public void setId(String id) {
    this.id = id;
  }

  public String getType() {
    return type;
  }

  public void setType(String type) {
    this.type = type;
  }
  //~ Methods ----------------------------------------------------------------------------------------------------------

  /**
   * @see  Object#equals(Object)
   */
  @Override public boolean equals(Object o) {
    if (this == o) {
      return true;
    }

    if ((o == null) || (getClass() != o.getClass())) {
      return false;
    }

    Principal principal = (Principal) o;

    return new EqualsBuilder().append(bindno,principal.bindno).append(bindtype,principal.bindtype).isEquals();
  }

  /**
   * @see  Object#hashCode()
   */
  @Override public int hashCode() {
    return new HashCodeBuilder(17, 37).append(bindno).append(bindtype).toHashCode();
  }

  /**
   * @see  Object#toString()
   */
  @Override public String toString() {
    return new ToStringBuilder(this).append("bindno",bindno).append("bindtype",bindtype).toString();
  }
} // end class Principal
